home *** CD-ROM | disk | FTP | other *** search
/ Champak 56 / Volume 56 - JOGO DISK .iso / Games / frograce.swf / scripts / frame_4 / DoAction.as
Text File  |  2008-01-11  |  41KB  |  1,214 lines

  1. function buildMap(map)
  2. {
  3.    attachMovie("empty","tiles",++d);
  4.    track.clip = tiles;
  5.    var _loc3_ = map.length;
  6.    var _loc2_ = 0;
  7.    while(_loc2_ < _loc3_)
  8.    {
  9.       var _loc1_ = "t_ply" + _loc2_;
  10.       track[_loc1_] = new track["tile" + map[_loc2_]]();
  11.       track.clip.attachMovie("tile",_loc1_,_loc2_);
  12.       track.clip[_loc1_]._x = frogPLY.xPos - track.tileW / 2;
  13.       track.clip[_loc1_]._y = 360 + _loc2_ * (- track.tileH);
  14.       runTrackPLY(track.clip[_loc1_],track[_loc1_].types,track[_loc1_].reach);
  15.       track.clip[_loc1_].gotoAndStop(track[_loc1_].frame);
  16.       _loc2_ = _loc2_ + 1;
  17.    }
  18.    track.clip.attachMovie("frog","frogPLY",10000);
  19.    frogPLY.clip = track.clip.frogPLY;
  20.    frogPLY.clip._x = frogPLY.xPos;
  21.    frogPLY.clip._y = frogPLY.yPos;
  22.    _loc2_ = 0;
  23.    while(_loc2_ < _loc3_)
  24.    {
  25.       _loc1_ = "t_cpu" + _loc2_;
  26.       track[_loc1_] = new track["tile" + map[_loc2_]]();
  27.       track.clip.attachMovie("tile",_loc1_,_loc2_ + 1000);
  28.       track.clip[_loc1_]._x = frogCPU.xPos - track.tileW / 2;
  29.       track.clip[_loc1_]._y = 360 + _loc2_ * (- track.tileH);
  30.       runTrackCPU(track.clip[_loc1_],track[_loc1_].types,track[_loc1_].reach);
  31.       track.clip[_loc1_].gotoAndStop(track[_loc1_].frame);
  32.       _loc2_ = _loc2_ + 1;
  33.    }
  34.    track.clip.attachMovie("frog2","frogCPU",20000);
  35.    frogCPU.clip = track.clip.frogCPU;
  36.    frogCPU.clip._x = frogCPU.xPos;
  37.    frogCPU.clip._y = frogCPU.yPos;
  38. }
  39. function stopFrogPLY()
  40. {
  41.    removeMovieClip(track.clip[frogPLY.currentHit]);
  42.    clearInterval(frogPLY.timerID);
  43.    frogPLY.clip.gotoAndStop("up");
  44.    frogPLY.clip._y = 300;
  45.    frogPLY.keyLock = false;
  46.    frog.clip._yscale = 100;
  47.    frog.clip._xscale = 100;
  48.    if(frogPLY.blockThrough == false)
  49.    {
  50.       frogPLY.blockPos = frogPLY.blockPos + 1;
  51.       eval("movPower" + frogPLY.trackSide).target._y = -10 * frogPLY.hBlock[frogPLY.blockPos];
  52.    }
  53.    else
  54.    {
  55.       frogPLY.blockThrough = false;
  56.    }
  57. }
  58. function stopFrogCPU()
  59. {
  60.    removeMovieClip(track.clip[frogCPU.currentHit]);
  61.    clearInterval(frogCPU.timerID);
  62.    frogCPU.clip.gotoAndStop("up");
  63.    frogCPU.clip._y = 300;
  64.    frogCPU.keyLock = false;
  65.    frogCPU.timerToJump = setInterval(runFrog,frogCPU.wait);
  66.    frogCPU.clip._yscale = 100;
  67.    frogCPU.clip._xscale = 100;
  68.    if(frogCPU.blockThrough == false)
  69.    {
  70.       frogCPU.blockPos = frogCPU.blockPos + 1;
  71.       eval("movPower" + frogCPU.trackSide).target._y = -10 * frogCPU.hBlock[frogCPU.blockPos];
  72.    }
  73.    else
  74.    {
  75.       frogCPU.blockThrough = false;
  76.    }
  77. }
  78. function setBackPLY(obj, n)
  79. {
  80.    nm = obj._name.substr(5);
  81.    var i = Number(nm) - 4;
  82.    while(i < Number(nm))
  83.    {
  84.       track.clip["t_ply" + i]._y += n;
  85.       i++;
  86.    }
  87.    eval("movTrack" + frogPLY.trackSide)._y += n;
  88. }
  89. function setBackCPU(obj, n)
  90. {
  91.    nm = obj._name.substr(5);
  92.    var i = Number(nm) - 4;
  93.    while(i < Number(nm))
  94.    {
  95.       track.clip["t_cpu" + i]._y += n;
  96.       i++;
  97.    }
  98.    eval("movTrack" + frogCPU.trackSide)._y += n;
  99. }
  100. function countBlockPLY()
  101. {
  102.    var _loc4_ = 0;
  103.    var _loc3_ = undefined;
  104.    var _loc2_ = undefined;
  105.    var _loc1_ = 0;
  106.    while(_loc1_ < 100)
  107.    {
  108.       _loc3_ = track["t_ply" + _loc1_].reach;
  109.       _loc2_ = track["t_ply" + _loc1_].types;
  110.       if(_loc3_ >= 0 && _loc2_ != "empty" && _loc2_ != "pool" && _loc2_ != "endofpool" && _loc2_ != "midofpool")
  111.       {
  112.          frogPLY.hBlock[_loc4_] = _loc3_;
  113.          _loc4_ = _loc4_ + 1;
  114.       }
  115.       _loc1_ = _loc1_ + 1;
  116.    }
  117. }
  118. function countBlockCPU()
  119. {
  120.    var _loc3_ = 0;
  121.    var _loc4_ = undefined;
  122.    var _loc2_ = undefined;
  123.    var _loc1_ = 0;
  124.    while(_loc1_ < 100)
  125.    {
  126.       _loc4_ = track["t_cpu" + _loc1_].reach;
  127.       _loc2_ = track["t_cpu" + _loc1_].types;
  128.       if(_loc4_ >= 0 && _loc2_ != "empty" && _loc2_ != "pool" && _loc2_ != "endofpool" && _loc2_ != "midofpool")
  129.       {
  130.          frogCPU.hBlock[_loc3_] = _loc4_;
  131.          frogCPU.idBlock[_loc3_] = _loc1_;
  132.          frogCPU.tyBlock[_loc3_] = _loc2_;
  133.          _loc3_ = _loc3_ + 1;
  134.       }
  135.       _loc1_ = _loc1_ + 1;
  136.    }
  137. }
  138. function runFrog()
  139. {
  140.    clearInterval(frogCPU.timerToJump);
  141.    frogCPU.toRun = true;
  142. }
  143. function aiFrog(a, b, c)
  144. {
  145.    var _loc1_ = undefined;
  146.    if(c == "block" || c == "oil" || c == "trap")
  147.    {
  148.       if(a > 5)
  149.       {
  150.          _loc1_ = psBOT[b][4];
  151.       }
  152.       else
  153.       {
  154.          _loc1_ = psBOT[b][a - 1];
  155.       }
  156.       if(frogCPU.insideCarton == true)
  157.       {
  158.          d = random(5) + 1;
  159.       }
  160.       else
  161.       {
  162.          d = _loc1_.substr(random(_loc1_.length),1);
  163.       }
  164.    }
  165.    else if(c == "bounce")
  166.    {
  167.       if(a > 5)
  168.       {
  169.          _loc1_ = psBounce[4];
  170.       }
  171.       else
  172.       {
  173.          _loc1_ = psBounce[a - 1];
  174.       }
  175.       if(frogCPU.insideCarton == true)
  176.       {
  177.          d = random(5) + 1;
  178.       }
  179.       else
  180.       {
  181.          d = _loc1_.substr(random(_loc1_.length),1);
  182.       }
  183.    }
  184.    else if(c == "item")
  185.    {
  186.       if(a > 5)
  187.       {
  188.          _loc1_ = psItem[4];
  189.       }
  190.       else
  191.       {
  192.          _loc1_ = psItem[a - 1];
  193.       }
  194.       if(frogCPU.insideCarton == true)
  195.       {
  196.          d = random(5) + 1;
  197.       }
  198.       else
  199.       {
  200.          d = _loc1_.substr(random(_loc1_.length),1);
  201.       }
  202.    }
  203.    else if(c == "finish")
  204.    {
  205.       if(a > 5)
  206.       {
  207.          _loc1_ = psFinish[4];
  208.       }
  209.       else
  210.       {
  211.          _loc1_ = psFinish[a - 1];
  212.       }
  213.       if(frogCPU.insideCarton == true)
  214.       {
  215.          d = random(5) + 1;
  216.       }
  217.       else
  218.       {
  219.          d = _loc1_.substr(random(_loc1_.length),1);
  220.       }
  221.    }
  222.    else if(c == "startofpool")
  223.    {
  224.       if(a > 5)
  225.       {
  226.          _loc1_ = psPool[4];
  227.       }
  228.       else
  229.       {
  230.          _loc1_ = psPool[a - 1];
  231.       }
  232.       if(frogCPU.insideCarton == true)
  233.       {
  234.          d = random(5) + 1;
  235.       }
  236.       else
  237.       {
  238.          d = _loc1_.substr(random(_loc1_.length),1);
  239.       }
  240.    }
  241.    else if(c == "carton")
  242.    {
  243.       if(a > 5)
  244.       {
  245.          d = random(5) + 1;
  246.       }
  247.       else
  248.       {
  249.          d = random(5) + 1;
  250.       }
  251.    }
  252.    return d;
  253. }
  254. function jumpFromPoolPLY()
  255. {
  256.    clearInterval(frogPLY.timerID);
  257.    frogPLY.hit = true;
  258.    frogPLY.keyLock = true;
  259.    frogPLY.swim = false;
  260.    frogPLY.yMove = 5;
  261.    frogPLY.yMapMove = 0.2;
  262.    frogPLY.scale = 5;
  263.    frogPLY.powerValue = 1;
  264.    frogPLY.clip._yscale = 100;
  265.    frogPLY.clip._xscale = 100;
  266.    frogPLY.staminaCost = 0.25;
  267.    frogPLY.clip.gotoAndPlay(2);
  268.    frogPLY.blockPos = frogPLY.blockPos + 1;
  269.    eval("movPower" + frogPLY.trackSide).target._y = -10 * frogPLY.hBlock[frogPLY.blockPos];
  270. }
  271. function jumpFromMidPLY()
  272. {
  273.    clearInterval(frogPLY.timerID);
  274.    frogPLY.hit = true;
  275.    frogPLY.keyLock = true;
  276.    frogPLY.swim = false;
  277.    frogPLY.yMove = 5;
  278.    frogPLY.yMapMove = 0.2;
  279.    frogPLY.scale = 5;
  280.    frogPLY.powerValue = 1;
  281.    frogPLY.clip._yscale = 100;
  282.    frogPLY.clip._xscale = 100;
  283.    frogPLY.staminaCost = 0.25;
  284.    frogPLY.clip.gotoAndPlay(2);
  285. }
  286. function jumpFromPoolCPU()
  287. {
  288.    clearInterval(frogCPU.timerID);
  289.    frogCPU.hit = true;
  290.    frogCPU.keyLock = true;
  291.    frogCPU.swim = false;
  292.    frogCPU.toRun = false;
  293.    frogCPU.yMove = 5;
  294.    frogCPU.yMapMove = 0.2;
  295.    frogCPU.scale = 5;
  296.    frogCPU.powerValue = 1;
  297.    frogCPU.clip._yscale = 100;
  298.    frogCPU.clip._xscale = 100;
  299.    frogCPU.staminaCost = 0.25;
  300.    frogCPU.clip.gotoAndPlay(2);
  301.    frogCPU.blockPos = frogCPU.blockPos + 1;
  302.    eval("movPower" + frogCPU.trackSide).target._y = -10 * frogCPU.hBlock[frogCPU.blockPos];
  303. }
  304. function jumpFromMidCPU()
  305. {
  306.    clearInterval(frogCPU.timerID);
  307.    frogCPU.hit = true;
  308.    frogCPU.keyLock = true;
  309.    frogCPU.swim = false;
  310.    frogCPU.toRun = false;
  311.    frogCPU.yMove = 5;
  312.    frogCPU.yMapMove = 0.2;
  313.    frogCPU.scale = 5;
  314.    frogCPU.powerValue = 1;
  315.    frogCPU.clip._yscale = 100;
  316.    frogCPU.clip._xscale = 100;
  317.    frogCPU.staminaCost = 0.25;
  318.    frogCPU.clip.gotoAndPlay(2);
  319. }
  320. function inCartonPLY()
  321. {
  322.    clearInterval(frogPLY.cartonTimer);
  323.    frogPLY.insideCarton = false;
  324.    if(frogPLY.yMove == 0)
  325.    {
  326.       frogPLY.clip.gotoAndStop("up");
  327.    }
  328.    eval("movPower" + frogPLY.trackSide)._visible = true;
  329. }
  330. function inCartonCPU()
  331. {
  332.    clearInterval(frogCPU.cartonTimer);
  333.    frogCPU.insideCarton = false;
  334.    if(frogCPU.yMove == 0)
  335.    {
  336.       frogCPU.clip.gotoAndStop("up");
  337.    }
  338. }
  339. function startSwimCPU()
  340. {
  341.    clearInterval(frogCPU.timerID);
  342.    frogCPU.keyLock = false;
  343. }
  344. function runTrackPLY(obj, typesValue, reachValue)
  345. {
  346.    obj.onEnterFrame = function()
  347.    {
  348.       this._y += frogPLY.yMove;
  349.       if(this._y >= 450)
  350.       {
  351.          removeMovieClip(this);
  352.       }
  353.       if(frogPLY.reach <= reachValue && typesValue == "carton" && this.hitPoint.hitTest(frogPLY.clip.hitPoint))
  354.       {
  355.          clearInterval(frogPLY.cartonTimer);
  356.          frogPLY.insideCarton = true;
  357.          frogPLY.clip.gotoAndPlay("carton");
  358.          removeMovieClip(this);
  359.          eval("movPower" + frogPLY.trackSide)._visible = false;
  360.          frogPLY.cartonTimer = setInterval(inCartonPLY,20000);
  361.          frogPLY.blockPos = frogPLY.blockPos + 1;
  362.          eval("movPower" + frogPLY.trackSide).target._y = -10 * frogPLY.hBlock[frogPLY.blockPos];
  363.       }
  364.       else if(frogPLY.reach > reachValue && typesValue == "carton" && this.hitPoint.hitTest(frogPLY.clip.hitPoint))
  365.       {
  366.          frogPLY.blockPos = frogPLY.blockPos + 1;
  367.          eval("movPower" + frogPLY.trackSide).target._y = -10 * frogPLY.hBlock[frogPLY.blockPos];
  368.       }
  369.       if(frogPLY.reach <= reachValue && typesValue == "leaf" && this.hitPoint.hitTest(frogPLY.clip.hitPoint) && frogPLY.hit == false)
  370.       {
  371.          frogPLY.hit = true;
  372.          frogPLY.blockPos = frogPLY.blockPos + 1;
  373.          eval("movPower" + frogPLY.trackSide).target._y = -10 * frogPLY.hBlock[frogPLY.blockPos];
  374.       }
  375.       if(frogPLY.reach <= reachValue && typesValue == "block" && this.hitPoint.hitTest(frogPLY.clip.hitPoint))
  376.       {
  377.          frogPLY.blockThrough = false;
  378.          frogPLY.keyLock = true;
  379.          frogPLY.currentHit = this._name;
  380.          frogPLY.yMove = 0;
  381.          frogPLY.yMapMove = 0;
  382.          frogPLY.scale = 0;
  383.          frogPLY.scoreValue -= 5;
  384.          timerScore = setInterval(count,1);
  385.          s = -5;
  386.          n = -1;
  387.          setBackPLY(this,5);
  388.          frogPLY.clip._yscale = 100;
  389.          frogPLY.clip._xscale = 100;
  390.          frogPLY.clip._y = this._y + 60;
  391.          eval("movPower" + frogPLY.trackSide).sign._y = 0;
  392.          clearInterval(frogPLY.cartonTimer);
  393.          frogPLY.insideCarton = false;
  394.          eval("movPower" + frogPLY.trackSide)._visible = true;
  395.          frogPLY.clip.gotoAndPlay("hit");
  396.          frogPLY.timerID = setInterval(stopFrogPLY,3000);
  397.       }
  398.       else if(frogPLY.reach > reachValue && typesValue == "block" && this.hitPoint.hitTest(frogPLY.clip.hitPoint))
  399.       {
  400.          frogPLY.scoreValue += (10 * reachValue + 10) / 2;
  401.          timerScore = setInterval(count,1);
  402.          s = (10 * reachValue + 10) / 2;
  403.          n = 1;
  404.          frogPLY.blockPos = frogPLY.blockPos + 1;
  405.          eval("movPower" + frogPLY.trackSide).target._y = -10 * frogPLY.hBlock[frogPLY.blockPos];
  406.       }
  407.       if(frogPLY.reach == reachValue && typesValue == "oil" && this.hitPoint.hitTest(frogPLY.clip.hitPoint))
  408.       {
  409.          frogPLY.blockThrough = true;
  410.          frogPLY.keyLock = true;
  411.          frogPLY.currentHit = this._name;
  412.          frogPLY.yMove = 0;
  413.          frogPLY.yMapMove = 0;
  414.          frogPLY.scale = 0;
  415.          frogPLY.scoreValue -= 5;
  416.          timerScore = setInterval(count,1);
  417.          s = -5;
  418.          n = -1;
  419.          clearInterval(frogPLY.cartonTimer);
  420.          frogPLY.insideCarton = false;
  421.          eval("movPower" + frogPLY.trackSide)._visible = true;
  422.          frogPLY.clip.gotoAndPlay("plop");
  423.          frogPLY.timerID = setInterval(stopFrogPLY,5000);
  424.       }
  425.       else if(frogPLY.reach != reachValue && typesValue == "oil" && this.hitPoint.hitTest(frogPLY.clip.hitPoint))
  426.       {
  427.          frogPLY.blockThrough = true;
  428.          frogPLY.blockPos = frogPLY.blockPos + 1;
  429.          eval("movPower" + frogPLY.trackSide).target._y = -10 * frogPLY.hBlock[frogPLY.blockPos];
  430.       }
  431.       if(frogPLY.reach == reachValue && typesValue == "trap" && this.hitPoint.hitTest(frogPLY.clip.hitPoint))
  432.       {
  433.          frogPLY.keyLock = true;
  434.          frogPLY.currentHit = this._name;
  435.          frogPLY.yMove = 0;
  436.          frogPLY.yMapMove = 0;
  437.          frogPLY.scale = 0;
  438.          frogPLY.scoreValue -= 5;
  439.          timerScore = setInterval(count,1);
  440.          s = -5;
  441.          n = -1;
  442.          clearInterval(frogPLY.cartonTimer);
  443.          frogPLY.insideCarton = false;
  444.          eval("movPower" + frogPLY.trackSide)._visible = true;
  445.          this.movTrap.gotoAndStop(2);
  446.          frogPLY.clip.gotoAndPlay("trap");
  447.          frogPLY.timerID = setInterval(stopFrogPLY,7000);
  448.       }
  449.       else if(frogPLY.reach != reachValue && typesValue == "trap" && this.hitPoint.hitTest(frogPLY.clip.hitPoint))
  450.       {
  451.          frogPLY.blockThrough = true;
  452.          frogPLY.blockPos = frogPLY.blockPos + 1;
  453.          eval("movPower" + frogPLY.trackSide).target._y = -10 * frogPLY.hBlock[frogPLY.blockPos];
  454.       }
  455.       if(frogPLY.reach == reachValue && typesValue == "bounce" && this.hitPoint.hitTest(frogPLY.clip.hitPoint) && frogPLY.hit == false)
  456.       {
  457.          frogPLY.hit = true;
  458.          frogPLY.keyLock = true;
  459.          frogPLY.powerValue = frogPLY.currentPower;
  460.          frogPLY.yMove = 5;
  461.          frogPLY.yMapMove = 0.2;
  462.          frogPLY.scale = 5;
  463.          frogPLY.scoreValue += 10 * frogPLY.currentPower;
  464.          timerScore = setInterval(count,1);
  465.          s = 10 * frogPLY.currentPower;
  466.          n = 5;
  467.          setBackPLY(this,-5);
  468.          if(frogPLY.insideCarton == false)
  469.          {
  470.             frogPLY.clip.gotoAndPlay(2);
  471.          }
  472.       }
  473.       else if(frogPLY.reach != reachValue && typesValue == "bounce" && this.hitPoint.hitTest(frogPLY.clip.hitPoint))
  474.       {
  475.          frogPLY.blockPos = frogPLY.blockPos + 1;
  476.          eval("movPower" + frogPLY.trackSide).target._y = -10 * frogPLY.hBlock[frogPLY.blockPos];
  477.       }
  478.       if(frogPLY.reach == reachValue && typesValue == "startofpool" && this.hitPoint.hitTest(frogPLY.clip.hitPoint) && frogPLY.swim == false)
  479.       {
  480.          frogPLY.swim = true;
  481.          frogPLY.scale = 0;
  482.          frogPLY.clip._yscale = 100;
  483.          frogPLY.clip._xscale = 100;
  484.          frogPLY.staminaCost = 0;
  485.          clearInterval(frogPLY.cartonTimer);
  486.          frogPLY.insideCarton = false;
  487.          eval("movPower" + frogPLY.trackSide)._visible = true;
  488.          frogPLY.clip.gotoAndPlay("downswim");
  489.          frogPLY.keyLock = true;
  490.       }
  491.       if(frogPLY.reach == reachValue && typesValue == "pool" && this.hitPoint.hitTest(frogPLY.clip.hitPoint) && frogPLY.swim == false)
  492.       {
  493.          frogPLY.swim = true;
  494.          frogPLY.scale = 0;
  495.          frogPLY.clip._yscale = 100;
  496.          frogPLY.clip._xscale = 100;
  497.          frogPLY.staminaCost = 0;
  498.          clearInterval(frogPLY.cartonTimer);
  499.          frogPLY.insideCarton = false;
  500.          eval("movPower" + frogPLY.trackSide)._visible = true;
  501.          frogPLY.clip.gotoAndPlay("downswim");
  502.          frogPLY.keyLock = true;
  503.       }
  504.       if(frogPLY.reach == reachValue && typesValue == "endofpool" && this.hitPoint.hitTest(frogPLY.clip.hitPoint) && frogPLY.hit == false && frogPLY.swim == true)
  505.       {
  506.          clearInterval(timerSwim);
  507.          frogPLY.hit = true;
  508.          frogPLY.keyLock = true;
  509.          frogPLY.swim = false;
  510.          frogPLY.scale = 5;
  511.          frogPLY.powerValue = 1;
  512.          frogPLY.clip._yscale = 100;
  513.          frogPLY.clip._xscale = 100;
  514.          frogPLY.staminaCost = 0.25;
  515.          frogPLY.clip.gotoAndPlay(2);
  516.          frogPLY.blockPos = frogPLY.blockPos + 1;
  517.          eval("movPower" + frogPLY.trackSide).target._y = -10 * frogPLY.hBlock[frogPLY.blockPos];
  518.       }
  519.       else if(frogPLY.reach == reachValue && typesValue == "endofpool" && this.hitPoint.hitTest(frogPLY.clip.hitPoint) && frogPLY.hit == false && frogPLY.swim == false)
  520.       {
  521.          frogPLY.hit = true;
  522.          frogPLY.scale = 0;
  523.          frogPLY.clip._yscale = 100;
  524.          frogPLY.clip._xscale = 100;
  525.          frogPLY.staminaCost = 0;
  526.          clearInterval(frogPLY.cartonTimer);
  527.          frogPLY.insideCarton = false;
  528.          eval("movPower" + frogPLY.trackSide)._visible = true;
  529.          frogPLY.clip.gotoAndPlay("downfloat");
  530.          frogPLY.keyLock = true;
  531.          frogPLY.timerID = setInterval(jumpFromPoolPLY,1000);
  532.       }
  533.       if(frogPLY.reach == reachValue && typesValue == "midofpool" && this.hitPoint.hitTest(frogPLY.clip.hitPoint) && frogPLY.hit == false && frogPLY.swim == true)
  534.       {
  535.          frogPLY.hit = true;
  536.          frogPLY.keyLock = true;
  537.          frogPLY.swim = false;
  538.          frogPLY.scale = 5;
  539.          frogPLY.powerValue = 1;
  540.          frogPLY.clip._yscale = 100;
  541.          frogPLY.clip._xscale = 100;
  542.          frogPLY.staminaCost = 0.25;
  543.          frogPLY.clip.gotoAndPlay(2);
  544.       }
  545.       else if(frogPLY.reach == reachValue && typesValue == "midofpool" && this.hitPoint.hitTest(frogPLY.clip.hitPoint) && frogPLY.hit == false && frogPLY.swim == false)
  546.       {
  547.          clearInterval(timerSwim);
  548.          frogPLY.hit = true;
  549.          frogPLY.scale = 0;
  550.          frogPLY.clip._yscale = 100;
  551.          frogPLY.clip._xscale = 100;
  552.          frogPLY.staminaCost = 0;
  553.          clearInterval(frogPLY.cartonTimer);
  554.          frogPLY.insideCarton = false;
  555.          eval("movPower" + frogPLY.trackSide)._visible = true;
  556.          frogPLY.clip.gotoAndPlay("downfloat");
  557.          frogPLY.keyLock = true;
  558.          frogPLY.timerID = setInterval(jumpFromMidPLY,1000);
  559.       }
  560.       if(frogPLY.reach == reachValue && typesValue == "item" && this.hitPoint.hitTest(frogPLY.clip.hitPoint) && frogPLY.insideCarton == false)
  561.       {
  562.          frogPLY.staminaValue = 100;
  563.          removeMovieClip(this);
  564.       }
  565.       else if(frogPLY.reach != reachValue && typesValue == "item" && this.hitPoint.hitTest(frogPLY.clip.hitPoint))
  566.       {
  567.          frogPLY.blockPos = frogPLY.blockPos + 1;
  568.          eval("movPower" + frogPLY.trackSide).target._y = -10 * frogPLY.hBlock[frogPLY.blockPos];
  569.       }
  570.       if(frogPLY.reach == reachValue && typesValue == "finish" && (this.hitPoint.hitTest(frogPLY.clip.hitPoint) || this._y > frogPLY.clip._y) && frogPLY.hit == false && gameStop == false)
  571.       {
  572.          frogPLY.hit = true;
  573.          gameStop = true;
  574.          frogPLY.keyLock = true;
  575.          frogPLY.yMove = 0;
  576.          frogPLY.yMapMove = 0;
  577.          frogPLY.scale = 0;
  578.          frogPLY.staminaCost = 0;
  579.          frogCPU.keyLock = true;
  580.          frogCPU.staminaCost = 0;
  581.          clearInterval(frogCPU.timerID);
  582.          clearInterval(frogCPU.cartonTimer);
  583.          if(trackToPlay == 30)
  584.          {
  585.             frogPLY.scoreValue += 5100;
  586.             timerScore = setInterval(count,10);
  587.             s = 5100;
  588.             n = 10;
  589.             winMsg = "congratulation you\'ve finished all track and won 5000 bonus points";
  590.          }
  591.          else
  592.          {
  593.             frogPLY.scoreValue += 100;
  594.             timerScore = setInterval(count,10);
  595.             s = 100;
  596.             n = 1;
  597.             winMsg = "";
  598.          }
  599.          clearInterval(frogPLY.cartonTimer);
  600.          frogPLY.insideCarton = false;
  601.          eval("movPower" + frogPLY.trackSide)._visible = true;
  602.          gotoAndStop("finish");
  603.          eval("movWinner.cover" + frogPLY.trackSide).gotoAndPlay(2);
  604.          eval("movWinner.cover" + frogCPU.trackSide).gotoAndStop("lose");
  605.          movWinner.anim._x = eval("movWinner.cover" + frogPLY.trackSide)._x;
  606.          movWinner.anim.get_point.text = "got " + s + " points";
  607.          movWinner.anim.gotoAndPlay(2);
  608.       }
  609.    };
  610. }
  611. function runTrackCPU(obj, typesValue, reachValue)
  612. {
  613.    obj.onEnterFrame = function()
  614.    {
  615.       this._y += frogCPU.yMove;
  616.       if(this._y >= 450)
  617.       {
  618.          removeMovieClip(this);
  619.       }
  620.       if(frogCPU.reach == reachValue && typesValue == "empty" && this.hitPoint.hitTest(frogCPU.clip.hitPoint) && frogCPU.hit == false)
  621.       {
  622.          frogCPU.hit = true;
  623.          frogCPU.timerToJump = setInterval(runFrog,frogCPU.wait);
  624.          frogCPU.frogPos = this._name.substr(5);
  625.       }
  626.       if(frogCPU.reach == reachValue && typesValue == "leaf" && this.hitPoint.hitTest(frogCPU.clip.hitPoint) && frogCPU.hit == false)
  627.       {
  628.          frogCPU.hit = true;
  629.          frogCPU.timerToJump = setInterval(runFrog,frogCPU.wait);
  630.          frogCPU.frogPos = this._name.substr(5);
  631.          frogCPU.blockPos = frogCPU.blockPos + 1;
  632.          eval("movPower" + frogCPU.trackSide).target._y = -10 * frogCPU.hBlock[frogCPU.blockPos];
  633.       }
  634.       if(frogCPU.reach <= reachValue && typesValue == "carton" && this.hitPoint.hitTest(frogCPU.clip.hitPoint))
  635.       {
  636.          clearInterval(frogCPU.cartonTimer);
  637.          frogCPU.insideCarton = true;
  638.          frogCPU.clip.gotoAndPlay("carton");
  639.          removeMovieClip(this);
  640.          frogCPU.timerToJump = setInterval(runFrog,frogCPU.wait);
  641.          frogCPU.cartonTimer = setInterval(inCartonCPU,20000);
  642.          frogCPU.blockPos = frogCPU.blockPos + 1;
  643.          eval("movPower" + frogCPU.trackSide).target._y = -10 * frogCPU.hBlock[frogCPU.blockPos];
  644.       }
  645.       else if(frogCPU.reach > reachValue && typesValue == "carton" && this.hitPoint.hitTest(frogCPU.clip.hitPoint))
  646.       {
  647.          frogCPU.blockPos = frogCPU.blockPos + 1;
  648.          eval("movPower" + frogCPU.trackSide).target._y = -10 * frogCPU.hBlock[frogCPU.blockPos];
  649.       }
  650.       if(frogCPU.reach <= reachValue && typesValue == "block" && this.hitPoint.hitTest(frogCPU.clip.hitPoint))
  651.       {
  652.          setBackCPU(this,5);
  653.          frogCPU.blockThrough = false;
  654.          frogCPU.keyLock = true;
  655.          frogCPU.currentHit = this._name;
  656.          frogCPU.yMove = 0;
  657.          frogCPU.yMapMove = 0;
  658.          frogCPU.scale = 0;
  659.          frogCPU.clip._yscale = 100;
  660.          frogCPU.clip._xscale = 100;
  661.          frogCPU.clip._y = this._y + 60;
  662.          eval("movPower" + frogCPU.trackSide).sign._y = 0;
  663.          clearInterval(frogCPU.cartonTimer);
  664.          frogCPU.insideCarton = false;
  665.          frogCPU.clip.gotoAndPlay("hit");
  666.          frogCPU.frogPos = this._name.substr(5);
  667.          frogCPU.timerID = setInterval(stopFrogCPU,3000);
  668.       }
  669.       else if(frogCPU.reach > reachValue && typesValue == "block" && this.hitPoint.hitTest(frogCPU.clip.hitPoint))
  670.       {
  671.          frogCPU.blockPos = frogCPU.blockPos + 1;
  672.          eval("movPower" + frogCPU.trackSide).target._y = -10 * frogCPU.hBlock[frogCPU.blockPos];
  673.       }
  674.       if(frogCPU.reach == reachValue && typesValue == "oil" && this.hitPoint.hitTest(frogCPU.clip.hitPoint))
  675.       {
  676.          frogCPU.blockThrough = true;
  677.          frogCPU.keyLock = true;
  678.          frogCPU.currentHit = this._name;
  679.          frogCPU.yMove = 0;
  680.          frogCPU.yMapMove = 0;
  681.          frogCPU.scale = 0;
  682.          clearInterval(frogCPU.cartonTimer);
  683.          frogCPU.insideCarton = false;
  684.          frogCPU.clip.gotoAndPlay("plop");
  685.          frogCPU.frogPos = this._name.substr(5);
  686.          frogCPU.timerID = setInterval(stopFrogCPU,5000);
  687.       }
  688.       else if(frogCPU.reach != reachValue && typesValue == "oil" && this.hitPoint.hitTest(frogCPU.clip.hitPoint))
  689.       {
  690.          frogCPU.blockThrough = true;
  691.          frogCPU.blockPos = frogCPU.blockPos + 1;
  692.          eval("movPower" + frogCPU.trackSide).target._y = -10 * frogCPU.hBlock[frogCPU.blockPos];
  693.       }
  694.       if(frogCPU.reach == reachValue && typesValue == "trap" && this.hitPoint.hitTest(frogCPU.clip.hitPoint))
  695.       {
  696.          frogCPU.keyLock = true;
  697.          frogCPU.currentHit = this._name;
  698.          frogCPU.yMove = 0;
  699.          frogCPU.yMapMove = 0;
  700.          frogCPU.scale = 0;
  701.          clearInterval(frogCPU.cartonTimer);
  702.          frogCPU.insideCarton = false;
  703.          this.movTrap.gotoAndStop(2);
  704.          frogCPU.clip.gotoAndPlay("trap");
  705.          frogCPU.frogPos = this._name.substr(5);
  706.          frogCPU.timerID = setInterval(stopFrogCPU,7000);
  707.       }
  708.       else if(frogCPU.reach != reachValue && typesValue == "trap" && this.hitPoint.hitTest(frogCPU.clip.hitPoint))
  709.       {
  710.          frogCPU.blockThrough = true;
  711.          frogCPU.blockPos = frogCPU.blockPos + 1;
  712.          eval("movPower" + frogCPU.trackSide).target._y = -10 * frogCPU.hBlock[frogCPU.blockPos];
  713.       }
  714.       if(frogCPU.reach == reachValue && typesValue == "bounce" && this.hitPoint.hitTest(frogCPU.clip.hitPoint) && frogCPU.hit == false)
  715.       {
  716.          frogCPU.hit = true;
  717.          frogCPU.keyLock = true;
  718.          frogCPU.powerValue = frogCPU.currentPower;
  719.          frogCPU.yMove = 5;
  720.          frogCPU.yMapMove = 0.2;
  721.          frogCPU.scale = 5;
  722.          setBackCPU(this,-5);
  723.          if(frogCPU.insideCarton == false)
  724.          {
  725.             frogCPU.clip.gotoAndPlay(2);
  726.          }
  727.       }
  728.       else if(frogCPU.reach != reachValue && typesValue == "bounce" && this.hitPoint.hitTest(frogCPU.clip.hitPoint))
  729.       {
  730.          frogCPU.blockPos = frogCPU.blockPos + 1;
  731.          eval("movPower" + frogCPU.trackSide).target._y = -10 * frogCPU.hBlock[frogCPU.blockPos];
  732.       }
  733.       if(frogCPU.reach == reachValue && typesValue == "startofpool" && this.hitPoint.hitTest(frogCPU.clip.hitPoint) && frogCPU.swim == false)
  734.       {
  735.          frogCPU.swim = true;
  736.          frogCPU.toRun = true;
  737.          frogCPU.scale = 0;
  738.          frogCPU.clip._yscale = 100;
  739.          frogCPU.clip._xscale = 100;
  740.          frogCPU.staminaCost = 0;
  741.          clearInterval(frogCPU.cartonTimer);
  742.          frogCPU.insideCarton = false;
  743.          frogCPU.clip.gotoAndPlay("downswim");
  744.          frogCPU.keyLock = true;
  745.          frogCPU.timerID = setInterval(startSwimCPU,1000);
  746.       }
  747.       if(frogCPU.reach == reachValue && typesValue == "pool" && this.hitPoint.hitTest(frogCPU.clip.hitPoint) && frogCPU.swim == false)
  748.       {
  749.          frogCPU.swim = true;
  750.          frogCPU.toRun = true;
  751.          frogCPU.scale = 0;
  752.          frogCPU.clip._yscale = 100;
  753.          frogCPU.clip._xscale = 100;
  754.          frogCPU.staminaCost = 0;
  755.          clearInterval(frogCPU.cartonTimer);
  756.          frogCPU.insideCarton = false;
  757.          frogCPU.clip.gotoAndPlay("downswim");
  758.          frogCPU.keyLock = true;
  759.          frogCPU.timerID = setInterval(startSwimCPU,1000);
  760.       }
  761.       if(frogCPU.reach == reachValue && typesValue == "endofpool" && this.hitPoint.hitTest(frogCPU.clip.hitPoint) && frogCPU.hit == false && frogCPU.swim == true)
  762.       {
  763.          frogCPU.hit = true;
  764.          frogCPU.keyLock = true;
  765.          frogCPU.swim = false;
  766.          frogCPU.toRun = false;
  767.          frogCPU.scale = 5;
  768.          frogCPU.powerValue = 1;
  769.          frogCPU.clip._yscale = 100;
  770.          frogCPU.clip._xscale = 100;
  771.          frogCPU.staminaCost = 0.25;
  772.          frogCPU.clip.gotoAndPlay(2);
  773.          frogCPU.blockPos = frogCPU.blockPos + 1;
  774.          eval("movPower" + frogCPU.trackSide).target._y = -10 * frogCPU.hBlock[frogCPU.blockPos];
  775.       }
  776.       else if(frogCPU.reach == reachValue && typesValue == "endofpool" && this.hitPoint.hitTest(frogCPU.clip.hitPoint) && frogCPU.hit == false && frogCPU.swim == false)
  777.       {
  778.          frogCPU.hit = true;
  779.          frogCPU.toRun = true;
  780.          frogCPU.scale = 0;
  781.          frogCPU.clip._yscale = 100;
  782.          frogCPU.clip._xscale = 100;
  783.          frogCPU.staminaCost = 0;
  784.          clearInterval(frogCPU.cartonTimer);
  785.          frogCPU.insideCarton = false;
  786.          frogCPU.clip.gotoAndPlay("downfloat");
  787.          frogCPU.keyLock = true;
  788.          frogCPU.timerID = setInterval(jumpFromPoolCPU,1000);
  789.       }
  790.       if(frogCPU.reach == reachValue && typesValue == "midofpool" && this.hitPoint.hitTest(frogCPU.clip.hitPoint) && frogCPU.hit == false && frogCPU.swim == true)
  791.       {
  792.          frogCPU.hit = true;
  793.          frogCPU.keyLock = true;
  794.          frogCPU.swim = false;
  795.          frogCPU.toRun = false;
  796.          frogCPU.scale = 5;
  797.          frogCPU.powerValue = 1;
  798.          frogCPU.clip._yscale = 100;
  799.          frogCPU.clip._xscale = 100;
  800.          frogCPU.staminaCost = 0.25;
  801.          frogCPU.clip.gotoAndPlay(2);
  802.       }
  803.       else if(frogCPU.reach == reachValue && typesValue == "midofpool" && this.hitPoint.hitTest(frogCPU.clip.hitPoint) && frogCPU.hit == false && frogCPU.swim == false)
  804.       {
  805.          frogCPU.hit = true;
  806.          frogCPU.toRun = true;
  807.          frogCPU.scale = 0;
  808.          frogCPU.clip._yscale = 100;
  809.          frogCPU.clip._xscale = 100;
  810.          frogCPU.staminaCost = 0;
  811.          clearInterval(frogCPU.cartonTimer);
  812.          frogCPU.insideCarton = false;
  813.          frogCPU.clip.gotoAndPlay("downfloat");
  814.          frogCPU.keyLock = true;
  815.          frogCPU.timerID = setInterval(jumpFromMidCPU,1000);
  816.       }
  817.       if(frogCPU.reach == reachValue && typesValue == "item" && this.hitPoint.hitTest(frogCPU.clip.hitPoint) && frogCPU.hit == false && frogCPU.insideCarton == false)
  818.       {
  819.          frogCPU.frogPos = this._name.substr(5);
  820.          frogCPU.hit = true;
  821.          frogCPU.staminaValue = 100;
  822.          removeMovieClip(this);
  823.          frogCPU.timerToJump = setInterval(runFrog,frogCPU.wait);
  824.       }
  825.       else if(frogCPU.reach != reachValue && typesValue == "item" && this.hitPoint.hitTest(frogCPU.clip.hitPoint))
  826.       {
  827.          frogCPU.blockPos = frogCPU.blockPos + 1;
  828.          eval("movPower" + frogCPU.trackSide).target._y = -10 * frogCPU.hBlock[frogCPU.blockPos];
  829.       }
  830.       if(frogCPU.reach == reachValue && typesValue == "finish" && (this.hitPoint.hitTest(frogCPU.clip.hitPoint) || this._y > frogCPU.clip._y) && frogCPU.hit == false && gameStop == false)
  831.       {
  832.          frogCPU.hit = true;
  833.          gameStop = true;
  834.          frogCPU.keyLock = true;
  835.          frogCPU.yMove = 0;
  836.          frogCPU.yMapMove = 0;
  837.          frogCPU.scale = 0;
  838.          frogCPU.staminaCost = 0;
  839.          frogPLY.keyLock = true;
  840.          frogPLY.staminaCost = 0;
  841.          frogPLY.lostValue = frogPLY.lostValue + 1;
  842.          clearInterval(frogPLY.timerID);
  843.          clearInterval(frogPLY.cartonTimer);
  844.          if(frogPLY.lostValue >= 3)
  845.          {
  846.             winMsg = "you\'ve reached your defeat limit, please try again..";
  847.          }
  848.          else if(trackToPlay == 30)
  849.          {
  850.             winMsg = "you\'ve defeated in final track, please try again..";
  851.          }
  852.          else
  853.          {
  854.             winMsg = "";
  855.          }
  856.          eval("scoreBoard" + frogPLY.trackSide).movLost.gotoAndStop(frogPLY.lostValue + 1);
  857.          clearInterval(frogCPU.cartonTimer);
  858.          frogCPU.insideCarton = false;
  859.          gotoAndStop("finish");
  860.          eval("movWinner.cover" + frogCPU.trackSide).gotoAndPlay(2);
  861.          eval("movWinner.cover" + frogPLY.trackSide).gotoAndStop("lose");
  862.          movWinner.anim._x = eval("movWinner.cover" + frogCPU.trackSide)._x;
  863.          movWinner.anim.get_point.text = "";
  864.          movWinner.anim.gotoAndPlay(2);
  865.       }
  866.    };
  867. }
  868. function count()
  869. {
  870.    c += n;
  871.    a += n;
  872.    if(c == s)
  873.    {
  874.       c = 0;
  875.       clearInterval(timerScore);
  876.    }
  877.    eval("scoreBoard" + frogPLY.trackSide).score = a;
  878. }
  879. function removeMovie()
  880. {
  881.    var _loc1_ = 0;
  882.    while(_loc1_ < 100)
  883.    {
  884.       removeMovieClip(track.clip["t_ply" + _loc1_]);
  885.       removeMovieClip(track.clip["t_cpu" + _loc1_]);
  886.       _loc1_ = _loc1_ + 1;
  887.    }
  888.    removeMovieClip(frogPLY.clip);
  889.    removeMovieClip(frogCPU.clip);
  890. }
  891. function writeData()
  892. {
  893.    mySo.data.sound = fOptSound;
  894.    mySo.data.music = fOptMusic;
  895.    mySo.flush();
  896. }
  897. function playMusic(soundID)
  898. {
  899.    musicObject = new Sound();
  900.    musicObject.attachSound(soundID);
  901.    musicObject.start(0,100);
  902. }
  903. function playSound(soundID)
  904. {
  905.    soundObject = new Sound();
  906.    soundObject.attachSound(soundID);
  907.    soundObject.start();
  908. }
  909. function swimFrogPLY()
  910. {
  911.    frogPLY.yMove = 2.5;
  912.    frogPLY.yMapMove = 0.1;
  913.    if(frogPLY.insideCarton == false)
  914.    {
  915.       frogPLY.clip.gotoAndStop("swim");
  916.    }
  917. }
  918. function EncrpytString(strVal)
  919. {
  920.    var _loc7_ = "aHfEjcDebChGiAfIjDbEjacD";
  921.    var _loc8_ = _loc7_.length;
  922.    var _loc11_ = "0";
  923.    var _loc3_ = "";
  924.    var _loc9_ = strVal.length;
  925.    var _loc1_ = 0;
  926.    _loc3_ = "";
  927.    var _loc4_ = undefined;
  928.    var _loc6_ = undefined;
  929.    var _loc2_ = undefined;
  930.    var _loc5_ = 0;
  931.    nCnt = 0;
  932.    while(nCnt < _loc9_)
  933.    {
  934.       _loc4_ = strVal.charCodeAt(nCnt);
  935.       if(_loc4_ >= 128)
  936.       {
  937.          _loc4_ = "X";
  938.       }
  939.       _loc6_ = _loc7_.charCodeAt(_loc1_);
  940.       _loc1_ += 1;
  941.       if(_loc1_ >= _loc8_)
  942.       {
  943.          _loc1_ = 0;
  944.       }
  945.       _loc2_ = _loc4_ % 16 + _loc6_;
  946.       _loc3_ += String.fromCharCode(_loc2_);
  947.       _loc5_ += _loc2_;
  948.       _loc6_ = _loc7_.charCodeAt(_loc1_);
  949.       _loc1_ += 1;
  950.       if(_loc1_ >= _loc8_)
  951.       {
  952.          _loc1_ = 0;
  953.       }
  954.       _loc2_ = Math.floor(_loc4_ / 16) + _loc6_;
  955.       _loc3_ += String.fromCharCode(_loc2_);
  956.       _loc5_ += _loc2_;
  957.       nCnt++;
  958.    }
  959.    _loc5_ %= 256;
  960.    _loc6_ = _loc7_.charCodeAt(_loc1_);
  961.    _loc1_ += 1;
  962.    if(_loc1_ >= _loc8_)
  963.    {
  964.       _loc1_ = 0;
  965.    }
  966.    _loc2_ = _loc5_ % 16 + _loc6_;
  967.    _loc3_ += String.fromCharCode(_loc2_);
  968.    _loc6_ = _loc7_.charCodeAt(_loc1_);
  969.    _loc1_ += 1;
  970.    if(_loc1_ >= _loc8_)
  971.    {
  972.       _loc1_ = 0;
  973.    }
  974.    _loc2_ = Math.floor(_loc5_ / 16) + _loc6_;
  975.    _loc3_ += String.fromCharCode(_loc2_);
  976.    return _loc3_;
  977. }
  978. function GetUrlParam(strUrl, strParam)
  979. {
  980.    var _loc4_ = strUrl.toLowerCase();
  981.    var _loc1_ = _loc4_.indexOf(strParam);
  982.    var _loc5_ = strParam.length;
  983.    if(_loc1_ > 0)
  984.    {
  985.       var _loc3_ = undefined;
  986.       var _loc2_ = _loc4_.indexOf("&",_loc1_ + _loc5_);
  987.       if(_loc2_ > 0)
  988.       {
  989.          _loc3_ = _loc2_ - _loc1_;
  990.       }
  991.       else
  992.       {
  993.          _loc3_ = strUrl.length - _loc1_;
  994.       }
  995.       return strUrl.substr(_loc1_ + _loc5_,_loc3_);
  996.    }
  997.    return "";
  998. }
  999. function GetBaseUrl(strUrl)
  1000. {
  1001.    var _loc1_ = strUrl.toLowerCase();
  1002.    var _loc2_ = _loc1_.length;
  1003.    var _loc3_ = _loc1_.indexOf("?",0);
  1004.    if(_loc3_ > 0)
  1005.    {
  1006.       _loc2_ = _loc3_;
  1007.    }
  1008.    var _loc4_ = "download";
  1009.    if(_loc1_.substr(0,4) == "http")
  1010.    {
  1011.       _loc4_ = strUrl.substr(7,_loc2_ - 7);
  1012.    }
  1013.    return _loc4_;
  1014. }
  1015. track = {tileW:40,tileH:40};
  1016. track.tile0 = function()
  1017. {
  1018. };
  1019. track.tile0.prototype.types = "empty";
  1020. track.tile0.prototype.reach = 0;
  1021. track.tile0.prototype.frame = "empty";
  1022. track.tile1 = function()
  1023. {
  1024. };
  1025. track.tile1.prototype.types = "block";
  1026. track.tile1.prototype.reach = 1;
  1027. track.tile1.prototype.frame = "block11";
  1028. track.tile2 = function()
  1029. {
  1030. };
  1031. track.tile2.prototype.types = "block";
  1032. track.tile2.prototype.reach = 1;
  1033. track.tile2.prototype.frame = "block12";
  1034. track.tile3 = function()
  1035. {
  1036. };
  1037. track.tile3.prototype.types = "block";
  1038. track.tile3.prototype.reach = 1;
  1039. track.tile3.prototype.frame = "block13";
  1040. track.tile4 = function()
  1041. {
  1042. };
  1043. track.tile4.prototype.types = "block";
  1044. track.tile4.prototype.reach = 2;
  1045. track.tile4.prototype.frame = "block21";
  1046. track.tile5 = function()
  1047. {
  1048. };
  1049. track.tile5.prototype.types = "block";
  1050. track.tile5.prototype.reach = 2;
  1051. track.tile5.prototype.frame = "block22";
  1052. track.tile6 = function()
  1053. {
  1054. };
  1055. track.tile6.prototype.types = "block";
  1056. track.tile6.prototype.reach = 2;
  1057. track.tile6.prototype.frame = "block23";
  1058. track.tile7 = function()
  1059. {
  1060. };
  1061. track.tile7.prototype.types = "block";
  1062. track.tile7.prototype.reach = 2;
  1063. track.tile7.prototype.frame = "block24";
  1064. track.tile8 = function()
  1065. {
  1066. };
  1067. track.tile8.prototype.types = "block";
  1068. track.tile8.prototype.reach = 3;
  1069. track.tile8.prototype.frame = "block31";
  1070. track.tile9 = function()
  1071. {
  1072. };
  1073. track.tile9.prototype.types = "block";
  1074. track.tile9.prototype.reach = 3;
  1075. track.tile9.prototype.frame = "block32";
  1076. track.tile10 = function()
  1077. {
  1078. };
  1079. track.tile10.prototype.types = "block";
  1080. track.tile10.prototype.reach = 3;
  1081. track.tile10.prototype.frame = "block33";
  1082. track.tile11 = function()
  1083. {
  1084. };
  1085. track.tile11.prototype.types = "block";
  1086. track.tile11.prototype.reach = 3;
  1087. track.tile11.prototype.frame = "block34";
  1088. track.tile12 = function()
  1089. {
  1090. };
  1091. track.tile12.prototype.types = "block";
  1092. track.tile12.prototype.reach = 3;
  1093. track.tile12.prototype.frame = "block35";
  1094. track.tile13 = function()
  1095. {
  1096. };
  1097. track.tile13.prototype.types = "block";
  1098. track.tile13.prototype.reach = 1;
  1099. track.tile13.prototype.frame = "block14";
  1100. track.tile14 = function()
  1101. {
  1102. };
  1103. track.tile14.prototype.types = "block";
  1104. track.tile14.prototype.reach = 1;
  1105. track.tile14.prototype.frame = "block15";
  1106. track.tile16 = function()
  1107. {
  1108. };
  1109. track.tile16.prototype.types = "oil";
  1110. track.tile16.prototype.reach = 0;
  1111. track.tile16.prototype.frame = "oil";
  1112. track.tile17 = function()
  1113. {
  1114. };
  1115. track.tile17.prototype.types = "trap";
  1116. track.tile17.prototype.reach = 0;
  1117. track.tile17.prototype.frame = "trap";
  1118. track.tile21 = function()
  1119. {
  1120. };
  1121. track.tile21.prototype.types = "startofpool";
  1122. track.tile21.prototype.reach = 0;
  1123. track.tile21.prototype.frame = "pool1";
  1124. track.tile22 = function()
  1125. {
  1126. };
  1127. track.tile22.prototype.types = "pool";
  1128. track.tile22.prototype.reach = 0;
  1129. track.tile22.prototype.frame = "pool2";
  1130. track.tile23 = function()
  1131. {
  1132. };
  1133. track.tile23.prototype.types = "midofpool";
  1134. track.tile23.prototype.reach = 0;
  1135. track.tile23.prototype.frame = "pool2";
  1136. track.tile24 = function()
  1137. {
  1138. };
  1139. track.tile24.prototype.types = "leaf";
  1140. track.tile24.prototype.reach = 0;
  1141. track.tile24.prototype.frame = "pool4";
  1142. track.tile25 = function()
  1143. {
  1144. };
  1145. track.tile25.prototype.types = "endofpool";
  1146. track.tile25.prototype.reach = 0;
  1147. track.tile25.prototype.frame = "pool3";
  1148. track.tile30 = function()
  1149. {
  1150. };
  1151. track.tile30.prototype.types = "bounce";
  1152. track.tile30.prototype.reach = 0;
  1153. track.tile30.prototype.frame = "bounce";
  1154. track.tile31 = function()
  1155. {
  1156. };
  1157. track.tile31.prototype.types = "item";
  1158. track.tile31.prototype.reach = 0;
  1159. track.tile31.prototype.frame = "item";
  1160. track.tile32 = function()
  1161. {
  1162. };
  1163. track.tile32.prototype.types = "carton";
  1164. track.tile32.prototype.reach = 1;
  1165. track.tile32.prototype.frame = "carton";
  1166. track.tile40 = function()
  1167. {
  1168. };
  1169. track.tile40.prototype.types = "start";
  1170. track.tile40.prototype.reach = 0;
  1171. track.tile40.prototype.frame = "start";
  1172. track.tile41 = function()
  1173. {
  1174. };
  1175. track.tile41.prototype.types = "finish";
  1176. track.tile41.prototype.reach = 0;
  1177. track.tile41.prototype.frame = "finish";
  1178. frogPLY = {xPos:Number,yPos:Number = 300,trackSide:Number,reach:Number = 0,power:Number = 0,yMove:Number = 0,scale:Number = 0,timer:Number = 0,powerTurn:Number = 0,powerValue:Number = 0,scoreValue:Number = 0,staminaValue:Number = 100,staminaCost:Number = 0.5,currentPower:Number = 0,currentHit:String,keyLock:Boolean,hit:Boolean = false,swim:Boolean = false,timerID:Number,blockThrough:Boolean,blockPos:Number = 1,hBlock:new Array(),idBlock:new Array(),tyBlock:new Array(),lostValue:Number,insideCarton:Boolean,cartonTimer:Number};
  1179. frogCPU = {xPos:Number,yPos:Number = 300,trackSide:Number,reach:Number = 0,power:Number = 0,yMove:Number = 0,scale:Number = 0,timer:Number = 0,powerTurn:Number = 0,powerValue:Number = 0,scoreValue:Number = 0,staminaValue:Number = 100,staminaCost:Number = 0.5,currentPower:Number = 0,currentHit:String,keyLock:Boolean,hit:Boolean = false,swim:Boolean = false,timerID:Number,timerToJump:Number,toRun:Boolean = false,go:Boolean = false,blockPos:Number = 1,frogPos:Number = 2,hPool:Number = 0,rangeBlock:Number,blockThrough:Boolean,hBlock:new Array(),idBlock:new Array(),tyBlock:new Array(),wait:Number,insideCarton:Boolean,cartonTimer:Number};
  1180. var control = new Object();
  1181. var gameStop = false;
  1182. var trackToPlay = 1;
  1183. var clickValue;
  1184. var trackHeight;
  1185. var winMsg = "";
  1186. var timerSwim;
  1187. var psBOT = new Array();
  1188. psBOT = [["2333445","233444555","223444555","22334555","23344"],["2333445","34455","24455","233555","23344"],["12","3445","1244555","223555","223334"],["12","344555","145555","112223","223334"]];
  1189. var psBounce = new Array("12333445","2234455","33345","34445","34555");
  1190. var psItem = new Array("1","1222","2333","3444","4555");
  1191. var psPool = new Array("5","155","1225","2333","3444");
  1192. var psFinish = new Array("12","23","23334","34445","4555");
  1193. var timerScore;
  1194. var n = 0;
  1195. var a = 0;
  1196. var c = 0;
  1197. var s = 0;
  1198. var musicObject;
  1199. var soundObject;
  1200. var fOptSound;
  1201. var fOptMusic;
  1202. var mySo = SharedObject.getLocal("userOption");
  1203. fOptSound = mySo.data.sound;
  1204. fOptMusic = mySo.data.music;
  1205. if(fOptSound == undefined && fOptMusic == undefined)
  1206. {
  1207.    fOptSound = 1;
  1208.    fOptMusic = 1;
  1209. }
  1210. if(fOptMusic == 1)
  1211. {
  1212.    playMusic("music1.wav");
  1213. }
  1214.